import { createWebHistory, createRouter } from 'vue-router'


import Layout from '../views/layout/index.vue'
import Login from '../views/login/index.vue'
import User from '../views/user/index.vue'
import Admin from '../views/admin/index.vue'
import Card from '../views/card/index.vue'
import Home from '../views/home/index.vue'
import Order from '../views/order/index.vue'
import Type from '../views/type/index.vue'

const routes = [
  { path: '/', component: Login },
  { path: '/login', component: Login },
  { 
    path: '/layout',
    component: Layout,
    children: [
      {
        path: 'user',
        component: User
      },{
        path: 'admin',
        component: Admin
      },{
        path: 'card',
        component: Card
      },{
        path: 'home',
        component: Home
      },{
        path: 'order',
        component: Order
      },{
        path: 'type',
        component: Type
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router